package com.yanqu.road.server.cmd.activity.douluodalu;

import com.yanqu.road.pb.activity.BusyFarmingProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.douluodalu.CrossDouLuoDaLuMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_DOU_LUO_DA_HELP_CODE, desc = "补偿代码")
public class CrossDouLuoDaLuHelpCodeCmd extends CrossUnionCommand {

    int activityId;
    int type;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        BusyFarmingProto.BusyFarmingActivityHelpCode reqMsg = BusyFarmingProto.BusyFarmingActivityHelpCode.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        type = reqMsg.getType();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossDouLuoDaLuMgr.repair(activityId, type, groupId);
    }

    @Override
    public void sendData() {

    }
}
